﻿// Copyright (c) 2012 - 2021 Jared Zheng <jaredz at outlook dot com>
// Buddha Framework is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
//          http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
//
// Create : 2012-12-01 version 0.1 Jared Zheng <jaredz at outlook dot com>
// Update : 2021-03-19 version 4.0.0 Jared Zheng <jaredz at outlook dot com>

#ifndef __SERVER_SYSTEM_H__
#define __SERVER_SYSTEM_H__

#pragma once

#include "CommonServer.h"

///////////////////////////////////////////////////////////////////////////////////////////////////////////
/// 服务标准接口SubSystem : 通过UUID查找和创建服务实例
class CServerSystem : public CSubSystem
{
public:
    // CComponent
    virtual UInt  Command(PCXStr pszCMD, uintptr_t utParam) OVERRIDE;
    virtual UInt  Update(void) OVERRIDE;
    // CSubSystem
    virtual UInt  Init(void) OVERRIDE;
    virtual void  Exit(void) OVERRIDE;

    virtual Int   GetComponentInfo(MAP_COMPONENT_INFO& Components) const OVERRIDE;
    virtual bool  FindComponent(const CUUID& uuId) const OVERRIDE;
    virtual bool  CreateComponent(const CUUID& uuId, CComponentPtr& CComponentPtrRef) OVERRIDE;
public:
    CServerSystem(void);
    virtual ~CServerSystem(void);
private:
    CServerSystem(const CServerSystem&);
    CServerSystem& operator=(const CServerSystem&);
};

INLINE CServerSystem::CServerSystem(void)
{
}

INLINE CServerSystem::~CServerSystem(void)
{
}

INLINE CServerSystem::CServerSystem(const CServerSystem&)
{
}

INLINE CServerSystem& CServerSystem::operator=(const CServerSystem&)
{
    return (*this);
}
// CComponent
INLINE UInt CServerSystem::Command(PCXStr, uintptr_t)
{
    return 0;
}

INLINE UInt CServerSystem::Update(void)
{
    return 0;
}

INLINE UInt CServerSystem::Init(void)
{
    return (UInt)RET_OKAY;
}

INLINE void CServerSystem::Exit(void)
{
}

#endif // __SERVER_SYSTEM_H__
